home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / misc / cabern.zip / EXAMPLES / CONS_H.NET next >
Text File  |  1994-09-08  |  3KB  |  117 lines

  1.  
  2. (TimedNet$cons_h.net10#
  3. (TimedPlace$Producer_ready896#576#100#2#1#1#0#;1)
  4. (TimedPlace$Producer_after_communication896#1792#100#2#1#2#1#
  5. (TimedToken$Tk3T00#);1)
  6. (TimedPlace$Consumer_ready2624#576#100#2#1#3#1#
  7. (TimedToken$Tk1T00#);1)
  8. (TimedPlace$Consumer_after_communication2624#1792#100#2#1#4#0#;1)
  9. (TimedTransition$produce320#1152#100#1#1#5#TRUE;enab + 2.5enab + 3STRONG)
  10. (TimedTransition$communicate1792#1152#100#1#1#52#TRUE;enab + 2enab + 5STRONG)
  11. (TimedTransition$consume_wk3456#1152#100#1#1#7#TRUE;enab + 3enab + 5STRONG)
  12. (TimedPlace$stat3232#1440#100#2#1#8#1#
  13. (TimedToken$Tk2
  14. 0
  15. 0
  16. 0
  17. T00#);1)
  18. (TimedTransition$consumer_even2944#1152#100#1#1#9#;enab + 3enab + 8STRONG)
  19. (TimedTransition$consume_odd2432#1152#100#1#1#10#TRUE;enab+2enab+5STRONG)18#
  20. (Arc$A1320#576#0#0#0#0#0#0#20#0#1#8^2^1)
  21. (Arc$A21600#576#0#0#0#0#0#0#20#0#1#2^9^1)
  22. (Arc$A31920#576#0#0#0#0#0#0#20#0#1#5^9^1)
  23. (Arc$A41568#1792#0#0#0#0#0#0#20#0#1#9^3^1)
  24. (Arc$A5320#1792#0#0#0#0#0#0#20#0#1#3^8^1)
  25. (Arc$A61952#1792#0#0#0#0#0#0#20#0#1#9^7^1)
  26. (Arc$A73456#1792#0#0#0#0#0#0#20#0#1#7^10^1)
  27. (Arc$A83456#576#0#0#0#0#0#0#20#0#1#10^5^1)
  28. (Arc$A90#0#0#0#0#0#0#0#20#0#1#10^11^1)
  29. (Arc$A100#0#0#0#0#0#0#0#20#0#1#11^10^1)
  30. (Arc$A112944#1632#0#0#0#0#0#0#20#0#1#7^13^1)
  31. (Arc$A122432#1632#0#0#0#0#0#0#20#0#1#7^14^1)
  32. (Arc$A132432#768#0#0#0#0#0#0#20#0#1#14^5^1)
  33. (Arc$A142944#768#0#0#0#0#0#0#20#0#1#13^5^1)
  34. (Arc$A150#0#0#0#0#0#0#0#20#0#1#13^11^1)
  35. (Arc$A160#0#0#0#0#0#0#0#20#0#1#11^13^1)
  36. (Arc$A170#0#0#0#0#0#0#0#20#0#1#14^11^1)
  37. (Arc$A180#0#0#0#0#0#0#0#20#0#1#11^14^1)52##include <sys/types.h>
  38. #include <sys/times.h>
  39. #include <sys/timeb.h>
  40. class my_void {
  41.     public:
  42.         friend istream & operator >>(istream & strm, my_void & t)
  43.             {return strm;}
  44.             
  45.         friend ostream & operator << (ostream & strm, my_void  t)
  46.             {return strm;}
  47.         };
  48.  
  49. class my_record{
  50.     public:
  51.         int count1;
  52.         int count2;
  53.         int count3;
  54.         friend istream & operator >>(istream & strm, my_record & t)
  55.             {
  56.             strm >> t.count1 >> t.count2 >> t.count3;
  57.             return strm;
  58.             }
  59.             
  60.         friend ostream & operator << (ostream & strm, my_record  t)
  61.             {
  62.             strm << t.count1 <<"\n"<< t.count2 << "\n"<< t.count3 <<"\n";
  63.             return strm;
  64.             }
  65.         };
  66.  
  67. class timed_void{
  68.      public:
  69.          double time; 
  70.         my_void value;
  71.         friend istream & operator >>(istream & strm, timed_void & t)
  72.             {
  73.             strm >> t.time >> t.value;
  74.             return strm;
  75.             }
  76.             
  77.         friend ostream & operator << (ostream & strm, timed_void  t)
  78.             {
  79.             strm << t.time <<"\n"<< t.value << "\n";
  80.             return strm;
  81.             }
  82.         };
  83.  
  84. class timed_int{
  85.      public:
  86.          double time; 
  87.         int value;
  88.         friend istream & operator >>(istream & strm, timed_int & t)
  89.             {
  90.             strm >> t.time >> t.value;
  91.             return strm;
  92.             }
  93.             
  94.         friend ostream & operator << (ostream & strm, timed_int  t)
  95.             {
  96.             strm << t.time <<"\n"<< t.value << "\n";
  97.             return strm;
  98.             }
  99.         };
  100.         
  101. class timed_record{
  102.     public:
  103.          double time; 
  104.         my_record value;
  105.         friend istream & operator >>(istream & strm, timed_record & t)
  106.             {
  107.             strm >> t.time >> t.value;
  108.             return strm;
  109.             }
  110.             
  111.         friend ostream & operator << (ostream & strm, timed_record  t)
  112.             {
  113.             strm << t.time <<"\n"<< t.value << "\n";
  114.             return strm;
  115.             }
  116.         };
  117. T0==0)